package com.atguigu.foreach;

import com.atguigu.array.Student;

public class TestObjectArrays {
    public static void main(String[] args) {
        Student[] students = new Student[3];
        students[0] = new Student("张三", 89);
        students[1] = new Student("李四",84);
        students[2] = new Student("王五",90);

        //普通for循环
        for (int i = 0; i < students.length; i++) {
            System.out.println(students[i].display());
        }
        System.out.println("=========================");
        //增强for循环
        for (Student student : students) {
            System.out.println(student.display());
        }

    }
}
